import { createStore, applyMiddleware } from "redux"
import reducers from './reducer'
import { composeWithDevTools } from 'redux-devtools-extension'
import { persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import thunk from 'redux-thunk'

const persistConfig = {
  key: '@todo@',
  storage,
}

const persistedReducer = persistReducer(persistConfig, reducers)

export default createStore(persistedReducer, composeWithDevTools(applyMiddleware(thunk)))